<%--
  Created by IntelliJ IDEA.
  User: 86156
  Date: 2022/3/15
  Time: 15:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录</title>
    <script>
        window.onload = function(){
            document.getElementById("img").onclick = function(){
                // 加一个time 防止缓存
                this.src="checkCodeServlet?time="+new Date().getTime();
            }
        }
    </script>
    <style>
        div{
            color: red;
        }

    </style>

    </script>

</head>
<body>
<table>
    <form method="post" action="login">
        <tr>
            <td>
                账号:
            </td>
            <td>
                <input type="text" name="userName">
            </td>
        </tr>
        <tr>
            <td>
                密码:
            </td>
            <td>
                <input type="password" name="password">
            </td>
        </tr>
        <tr>
            <td>验证码</td>
            <td><input type="text" name="checkCode"></td>
        </tr>
        <tr>
            <td colspan="2"><img id="img" src="checkCodeServlet"></td>
        </tr>

        <tr>
            <td></td>
            <td>
                <input type="submit" value="登录">
            </td>
            <td>
                <a href="register.jsp">注册</a>
            </td>
        </tr>
    </form>
    <div><%=request.getAttribute("cc_error") == null ? "" : request.getAttribute("cc_error")%></div>
    <div><%=request.getAttribute("login_error") == null ? "" : request.getAttribute("login_error") %></div>

</table>

</body>
</html>
